3.467 \(\int \sec ^2(c+d x) (a+i a \tan (c+d x))^n \, dx\)

Optimal. Leaf size=32 \[ -\frac{i (a+i a \tan (c+d x))^{n+1}}{a d (n+1)} \]

[Out]

((-I)*(a + I*a*Tan[c + d*x])^(1 + n))/(a*d*(1 + n))

________________________________________________________________________________________

Rubi [A]  time = 0.0462205, antiderivative size = 32, normalized size of antiderivative = 1., number of steps used = 2, number of rules used = 2, integrand size = 24, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.083, Rules used = {3487, 32} \[ -\frac{i (a+i a \tan (c+d x))^{n+1}}{a d (n+1)} \]

Antiderivative was successfully verified.

[In]

Int[Sec[c + d*x]^2*(a + I*a*Tan[c + d*x])^n,x]

[Out]

((-I)*(a + I*a*Tan[c + d*x])^(1 + n))/(a*d*(1 + n))

Rule 3487

Int[sec[(e_.) + (f_.)*(x_)]^(m_)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(n_), x_Symbol] :> Dist[1/(a^(m - 2)*b
*f), Subst[Int[(a - x)^(m/2 - 1)*(a + x)^(n + m/2 - 1), x], x, b*Tan[e + f*x]], x] /; FreeQ[{a, b, e, f, n}, x
] && EqQ[a^2 + b^2, 0] && IntegerQ[m/2]

Rule 32

Int[((a_.) + (b_.)*(x_))^(m_), x_Symbol] :> Simp[(a + b*x)^(m + 1)/(b*(m + 1)), x] /; FreeQ[{a, b, m}, x] && N
eQ[m, -1]

Rubi steps

\begin{align*} \int \sec ^2(c+d x) (a+i a \tan (c+d x))^n \, dx &=-\frac{i \operatorname{Subst}\left (\int (a+x)^n \, dx,x,i a \tan (c+d x)\right )}{a d}\\ &=-\frac{i (a+i a \tan (c+d x))^{1+n}}{a d (1+n)}\\ \end{align*}

Mathematica [B]  time = 12.9838, size = 111, normalized size = 3.47 \[ -\frac{i 2^{n+1} e^{i (c+d x)} \left (e^{i d x}\right )^n \left (\frac{e^{i (c+d x)}}{1+e^{2 i (c+d x)}}\right )^{n+1} \sec ^{-n}(c+d x) (\cos (d x)+i \sin (d x))^{-n} (a+i a \tan (c+d x))^n}{d (n+1)} \]

Antiderivative was successfully verified.

[In]

Integrate[Sec[c + d*x]^2*(a + I*a*Tan[c + d*x])^n,x]

[Out]

((-I)*2^(1 + n)*E^(I*(c + d*x))*(E^(I*d*x))^n*(E^(I*(c + d*x))/(1 + E^((2*I)*(c + d*x))))^(1 + n)*(a + I*a*Tan
[c + d*x])^n)/(d*(1 + n)*Sec[c + d*x]^n*(Cos[d*x] + I*Sin[d*x])^n)

________________________________________________________________________________________

Maple [A]  time = 0.019, size = 31, normalized size = 1. \begin{align*}{\frac{-i \left ( a+ia\tan \left ( dx+c \right ) \right ) ^{1+n}}{ad \left ( 1+n \right ) }} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(sec(d*x+c)^2*(a+I*a*tan(d*x+c))^n,x)

[Out]

-I*(a+I*a*tan(d*x+c))^(1+n)/a/d/(1+n)

________________________________________________________________________________________

Maxima [F(-2)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: ValueError} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(d*x+c)^2*(a+I*a*tan(d*x+c))^n,x, algorithm="maxima")

[Out]

Exception raised: ValueError

________________________________________________________________________________________

Fricas [B]  time = 2.00667, size = 165, normalized size = 5.16 \begin{align*} -\frac{2 i \, \left (\frac{2 \, a e^{\left (2 i \, d x + 2 i \, c\right )}}{e^{\left (2 i \, d x + 2 i \, c\right )} + 1}\right )^{n} e^{\left (2 i \, d x + 2 i \, c\right )}}{d n +{\left (d n + d\right )} e^{\left (2 i \, d x + 2 i \, c\right )} + d} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(d*x+c)^2*(a+I*a*tan(d*x+c))^n,x, algorithm="fricas")

[Out]

-2*I*(2*a*e^(2*I*d*x + 2*I*c)/(e^(2*I*d*x + 2*I*c) + 1))^n*e^(2*I*d*x + 2*I*c)/(d*n + (d*n + d)*e^(2*I*d*x + 2
*I*c) + d)

________________________________________________________________________________________

Sympy [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int \left (a \left (i \tan{\left (c + d x \right )} + 1\right )\right )^{n} \sec ^{2}{\left (c + d x \right )}\, dx \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(d*x+c)**2*(a+I*a*tan(d*x+c))**n,x)

[Out]

Integral((a*(I*tan(c + d*x) + 1))**n*sec(c + d*x)**2, x)

________________________________________________________________________________________

Giac [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int{\left (i \, a \tan \left (d x + c\right ) + a\right )}^{n} \sec \left (d x + c\right )^{2}\,{d x} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(d*x+c)^2*(a+I*a*tan(d*x+c))^n,x, algorithm="giac")

[Out]

integrate((I*a*tan(d*x + c) + a)^n*sec(d*x + c)^2, x)